home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #1
/
utv1n1s1.d64
/
calendar creator
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
9KB
|
398 lines
1 rem (c)1987 uptime magazine
2 rem (c)1987 softdisk publishing, inc.
3 :
4 rem authors: john bayes
5 rem dave hammond
6 :
9 uptime=(8*4096)+4
10 dim mnth$(12),maxday(12),days(31)
15 for a=1to12: read mnth$(a), maxday(a): next: print"[147]"
16 :
20 gosub 2000: rem *** set up screen ***
21 :
22 get k$: if (k$<>" ") and (k$<>chr$(140)) then 22
23 if k$=chr$(140) then poke 186,8: sys uptime
24 :
25 mn=0: mnth$="": gosub 2200: rem *** prompt #1 ***
26 :
30 get k$: if (k$<>"1") and (k$<>"2") then 30
35 on val(k$) gosub 2300, 2500: rem *** 1=month, 2=year ***
36 :
40 date$=mnth$+", "+t$
42 if mn=0 then date$="[212]he year "+t$
46 gosub 1800: rem *** pad the date ***
48 :
50 gosub 2600: rem *** prompt #2 ***
60 get k$: if (k$<"1") or (k$>"3") then 60
70 on val(k$) goto 100, 400, 700: rem *** 1-screen, 2-printer, 3-restart ***
95 :
96 rem ******************
97 rem output to screen
98 rem ******************
99 :
100 year$=right$(str$(yr),4): py=yr
108 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
109 :
110 for y=bmtolm
115 mn=y: yr=py
120 gosub 1700: rem *** display calendar template ***
130 gosub 6000: rem *** calc the calendar ***
140 gosub 1600: rem *** display days of month ***
145 :
150 print"";
165 p$="[195]alendar for "+mnth$(y)+", "+year$
170 z=int((40-len(p$))/2)
175 printspc(z)"[146][159]"p$
195 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
200 get k$: if k$<>" " then 200
210 gosub 1940: next
230 goto 20: rem *** restart ***
395 :
396 rem *******************
397 rem output to printer
398 rem *******************
399 :
400 gosub 2700: rem *** prompt for lptr ***
405 :
410 get k$: if (k$<>"1") and (k$<>"2") then 410
420 if k$="2" then goto 50
430 close 4: open4,4,7: if (st and 128) then close4: gosub 2800: goto 400
435 :
440 gosub 1400: rem *** def lptr strings ***
445 :
450 year$=right$(str$(yr),4): py=yr
460 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
465 :
466 rem ************
467 rem print loop
468 rem ************
469 :
470 mn=bm: yr=py
475 :
480 gosub 1700: rem *** display calendar template ***
490 gosub 6000: rem *** calc the calendar ***
500 gosub 1600: rem *** screen output ***
501 :
502 print"";
504 p$="[195]alendar for "+mnth$(bm)+", "+year$
506 z=int((40-len(p$))/2)
508 printspc(z)"[146][159]"p$
509 :
510 gosub 2900: rem *** lptr output ***
515 :
560 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
570 get k$: if k$<>" " then 570
580 gosub 1940: bm=bm+1: if bm<=lm then 470: rem *** continue
590 print#4: close4: goto 20: rem *** restart ***
695 :
696 rem *****************
697 rem incorrect entry
698 rem *****************
699 :
700 gosub 1900
710 print"";
720 gosub 2120
730 goto 22
995 :
996 rem ***************
997 rem calendar data
998 rem ***************
999 :
1000 data "[202]anuary",31,"[198]ebruary",29,"[205]arch",31
1010 data "[193]pril",30,"[205]ay",31,"[202]une",30,"[202]uly",31
1020 data "[193]ugust",31,"[211]eptember",30,"[207]ctober",31
1030 data "[206]ovember",30,"[196]ecember",31
1395 :
1396 rem ************************
1397 rem define printer strings
1398 rem ************************
1399 :
1400 p1$="[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178]"
1402 p2$="[192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
1404 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
1406 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
1408 p5$="[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177]"
1410 p6$="[192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]"
1412 p7$="[221] [221] [221] [221]"
1414 p8$=" [221] [221] [221] [221]"
1420 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
1430 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
1440 return
1595 :
1596 rem **********************
1597 rem print days to screen
1598 rem **********************
1599 :
1600 f=0: print"";
1605 for x=1toeom
1610 if (day(1)=0) then goto 1650
1611 :
1615 if f=1 then 1650
1620 f=1: b=day(1)
1630 for x1=1tob: print" ";
1640 next
1645 :
1650 x$=str$(x): if len(x$)>2 then x$=right$(x$,2)
1660 print"";x$;"";
1670 if peek(211)=38 then print:print"";
1675 if peek(214)=18 then print"[145][145]";
1680 next
1690 return
1695 :
1696 rem ******************
1697 rem display calendar
1698 rem ******************
1699 :
1700 print"";tl$
1710 print" [221][211]un.[221][205]on.[221][212]ue.[221][215]ed.[221][212]hr.[221][198]ri.[221][211]at.[221]"
1720 print" ";m2$
1730 for x=1to14
1740 p$=m1$: if (x/3)=int(x/3) then p$=m2$
1750 print" ";p$
1760 next
1770 print" "bl$
1780 return
1795 :
1796 rem **************
1797 rem pad the date
1798 rem **************
1799 :
1800 pad=int((18-len(date$))/2)
1810 for x=1topad
1820 date$=" "+date$
1830 next
1840 date$=left$(date$+" ",18)
1850 return
1895 :
1896 rem *****************
1897 rem clear text area
1898 rem *****************
1899 :
1900 print"";
1910 printspc(11)"[158] "
1920 print"";
1930 for x=1to4: printspc(11)"[158] ": next
1940 print"";
1950 for x=1to6: print" ";
1953 if x<6 then print
1955 next
1960 print"";
1970 return
1995 :
1996 rem ***************
1997 rem set up screen
1998 rem ***************
1999 :
2000 poke 53280,0: poke 53281,0
2010 printchr$(8)chr$(14)
2020 tl$="[176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]"
2030 bl$="[173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
2040 m1$="[221] [221] [221] [221] [221] [221] [221] [221]"
2050 m2$="[171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
2060 gosub 1700: rem *** display calendar ***
2120 printspc(4)"[159][208]ress the [211]pace [194]ar[159] to continue"
2125 printspc(7)"[159][208]ress [198]8[159] to exit to [213]p[212]ime"
2130 printspc(3)"[158](c)1987 [211]oftdisk [208]ublishing, [201]nc."
2140 printspc(9)"[151] "
2142 printspc(9)"[151] [158][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
2144 printspc(9)"[151] [158][221] [195]alendar [195]reator [221]"
2146 printspc(9)"[151] [158][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
2148 printspc(9)"[151] [158][221] by [221]"
2150 printspc(9)"[151] [158][221] [202]ohn [194]ayes [221]"
2152 printspc(9)"[151] [158][221] and [221]"
2154 printspc(9)"[151] [158][221] [196]ave [200]ammond [221]"
2156 printspc(10)"[158][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
2190 return
2195 :
2196 rem ***********
2197 rem prompt #1
2198